﻿/*********************************************************************************
**                                                                              **
**  Copyright (C) 2024 LiLong                                                   **
**  This file is part of GnssLogs.                                              **
**                                                                              **
**  GnssLogs is free software: you can redistribute it and/or modify            **
**  it under the terms of the GNU Lesser General Public License as published by **
**  the Free Software Foundation, either version 3 of the License, or           **
**  (at your option) any later version.                                         **
**                                                                              **
**  GnssLogs is distributed in the hope that it will be useful,                 **
**  but WITHOUT ANY WARRANTY; without even the implied warranty of              **
**  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               **
**  GNU Lesser General Public License for more details.                         **
**                                                                              **
**  You should have received a copy of the GNU Lesser General Public License    **
**  along with GnssLogs.  If not, see <https://www.gnu.org/licenses/>.          **
**********************************************************************************/
#pragma once

#include "FormatMacro.h"
#include "LogHeader.h"

#include <array>

namespace GnssLogs
{
namespace GPSCNAVRAWMESSAGE
{
enum class SignalType
{
    GPSL1CA,
    GPSL1CP,
    GPSL2Y,
    GPSL2C,
    GPSL2P,
    GPSL5,
    GLOL1CA,
    GLOL2CA,
    GLOL2P,
    GLOL3,
    SBASL1,
    SBASL5,
    GALE1,
    GALE5A,
    GALE5B,
    GALALTBOC,
    GALE6C,
    GALE6B,
    BDSB1D1,
    BDSB1D2,
    BDSB2D1,
    BDSB2D2,
    BDSB3D1,
    BDSB3D2,
    BDSB1C,
    BDSB2A,
    BDSB2BI,
    QZSSL1CA,
    QZSSL1CP,
    QZSSL2C,
    QZSSL5,
    QZSSL6P,
    NAVICL5SPS
};
struct Data
{
    LogHeader::Data header;
    uint32_t signalChannel;
    uint32_t prn;
    SignalType signalType;
    uint32_t messageID;
    std::array<uint8_t, 38> data;
    uint32_t crc32;
};
} // namespace GPSCNAVRAWMESSAGE
} // namespace GnssLogs

GNSSLOGS_ENUM_DECLARE_FORMATTER(GnssLogs::GPSCNAVRAWMESSAGE,
                                SignalType,
                                GPSL1CA,
                                GPSL1CP,
                                GPSL2Y,
                                GPSL2C,
                                GPSL2P,
                                GPSL5,
                                GLOL1CA,
                                GLOL2CA,
                                GLOL2P,
                                GLOL3,
                                SBASL1,
                                SBASL5,
                                GALE1,
                                GALE5A,
                                GALE5B,
                                GALALTBOC,
                                GALE6C,
                                GALE6B,
                                BDSB1D1,
                                BDSB1D2,
                                BDSB2D1,
                                BDSB2D2,
                                BDSB3D1,
                                BDSB3D2,
                                BDSB1C,
                                BDSB2A,
                                BDSB2BI,
                                QZSSL1CA,
                                QZSSL1CP,
                                QZSSL2C,
                                QZSSL5,
                                QZSSL6P,
                                NAVICL5SPS)
GNSSLOGS_DECLARE_FORMATTER(GnssLogs::GPSCNAVRAWMESSAGE::Data)